package com.cie2.janji.pages;

import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.cie2.janji.entities.Promise;
import com.cie2.janji.services.PromiseService;

public class PromiseDetail {

	private Long promiseId;
	
	@Property
	private Promise promise;
	
	//services
	@Inject
	private PromiseService promiseService;	
	
	void onActivate(Long promiseId) {
		this.promiseId = promiseId;
		
		promise = promiseService.load(promiseId);
		promise.getEntity(); // dummy invoker
	}

	Long onPassivate() {
		return promiseId;
	}	
}
